#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
void swap(int* a, int* b)
{
	int c = *a;
	*a = *b;
	*b = c;
}
void qucicksort(int* a, int left, int right)
{
	if (left >= right)
	{
		return;
	}
	int keyi = left;
	int begin = left;
	int end = right;
	while (begin < end)
	{
		while (begin<end && a[end]>a[keyi])
		{
			end--;
			end--;
		}
		while (begin < end && a[begin] < a[keyi])
		{
			begin++;
		}
		swap(&a[begin], &a[end]);
	}
	swap(&a[keyi], &a[end]);
	qucicksort(a, left, begin - 1);
	qucicksort(a, begin + 1, right);
}
int main()
{
	int a[10] = { 9,8,6,4,32,1,90,6575,233,2341 };
	qucicksort(a, 0, 9);
	for (int i = 0; i < 10; i++)
	{
		printf("%d ", a[i]);
	}
	return 0;
}